package com.humngyang.com.hmy.controller;


import com.humngyang.com.hmy.service.GoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/GoodsCategoryController")
public class GoodsCategoryController {

    @Autowired
    GoodsCategoryService goodsCategoryService;


    @RequestMapping("/getAllgoodCategoryTree")
    public Map<String, Object> getAllgoodCategoryTree() {
        Map<String, Object> re = new HashMap<>();
        List<Map<String, Object>> gcTreeList = goodsCategoryService.getAllgoodCategoryTree();
        re.put("flag", 1);
        re.put("list", gcTreeList);
        return re;
    }
}
